package br.com.paradigmas.modulos.cadastros.album;

import java.util.ArrayList;
import java.util.Scanner;

import br.com.paradigmas.modulos.consultas.artista.ConsultaArtista;
import br.com.paradigmas.modulos.consultas.musica.ConsultaMusica;
import br.com.paradigmas.persistencia.om.Album;
import br.com.paradigmas.persistencia.om.AlbumMusica;
import br.com.paradigmas.persistencia.om.Musica;

public class CadastroAlbum
{
	/*-*-*-* Variaveis *-*-*-*/
	AlbumMusica albumMusica;
	Scanner scanner = new Scanner(System.in);
	String captura = null;
	
	/*-*-*-* Metodos *-*-*-*/
	
	/**
	 * Adiciona uma musica ao Album
	 * 
	 * @author Djalma
	 * @param album
	 * @param musica
	 */
	public void adicionarMusica(Album album, Musica musica)
	{
		this.albumMusica.setAlbum(album);
		this.albumMusica.setMusica(musica);
	}
	
	public Album criarAlbum()
	{
		try 
		{
			Album album = new Album();
			
			System.out.println("Digite o nome do album: ");
			captura = scanner.next();
			
			album.setNome(captura);
			
			return album;
		} 
		catch (Exception e) 
		{ e.printStackTrace(); }
		return null;
	}
	
	public ArrayList<Album> getAlbuns()
	{
		try 
		{
			ArrayList<Album> albuns = new ArrayList<Album>();
			
			String nomeAlbum = "Bob Dylay";
			albuns.add(new Album(5001, nomeAlbum, new ConsultaMusica().getMusicas(null, nomeAlbum, "Album")));
			
			nomeAlbum = "Led Zeppelin";
			albuns.add(new Album(5002, nomeAlbum, new ConsultaMusica().getMusicas(null, nomeAlbum, "Album")));
			
			nomeAlbum = "Rolling Stones";
			albuns.add(new Album(5003, nomeAlbum, new ConsultaMusica().getMusicas(null, nomeAlbum, "Album")));
			
			return albuns;
		} 
		catch (Exception e) 
		{ e.printStackTrace(); }
		return null;
	}
}
